import java.awt.LayoutManager;
import java.awt.Rectangle;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
/**
 * Display Book popularity Report.
 *
 */
public class BookReportResultPGUI extends JPanel {

	private static final long serialVersionUID = 1L;
	private JLabel jlblBookId = null;
	public JTextField jtxtBookId = null;
	private JLabel jlbl = null;
	public JLabel jlblBookPop = null;
	public JButton jbtnBack = null;
	/**
	 * Create and initializes  BookReportResultPGUI
	 */
	public BookReportResultPGUI() {
		super();
		initialize();
	}

	public BookReportResultPGUI(LayoutManager layout) {
		super(layout);
		// TODO Auto-generated constructor stub
		initialize();
	}

	public BookReportResultPGUI(boolean isDoubleBuffered) {
		super(isDoubleBuffered);
		// TODO Auto-generated constructor stub
		initialize();
	}

	public BookReportResultPGUI(LayoutManager layout, boolean isDoubleBuffered) {
		super(layout, isDoubleBuffered);
		// TODO Auto-generated constructor stub
		initialize();
	}

	/**
	 * initializes BookReportResultPGUI
	 * 
	 * @return void
	 */
	private void initialize() {
		jlblBookPop = new JLabel();
		jlblBookPop.setBounds(new Rectangle(149, 75, 83, 20));
		jlblBookPop.setText("JLabel");
		jlbl = new JLabel();
		jlbl.setBounds(new Rectangle(24, 75, 91, 21));
		jlbl.setText("Book Popularity");
		jlblBookId = new JLabel();
		jlblBookId.setBounds(new Rectangle(29, 31, 81, 17));
		jlblBookId.setText("BookId");
		this.setSize(340, 219);
		this.setLayout(null);
		this.add(jlblBookId, null);
		this.add(getJtxtBookId(), null);
		this.add(jlbl, null);
		this.add(jlblBookPop, null);
		this.add(getJbtnBack(), null);
	}

	/**
	 *initializes jtxtBookId	
	 * 	
	 * @return jtxtBookId JTextField	
	 */
	private JTextField getJtxtBookId() {
		if (jtxtBookId == null) {
			jtxtBookId = new JTextField();
			jtxtBookId.setBounds(new Rectangle(136, 31, 101, 16));
		}
		return jtxtBookId;
	}

	/**
	 *initializes jbtnBack	
	 * 	
	 * @return jbtnBack JButton
	 */
	private JButton getJbtnBack() {
		if (jbtnBack == null) {
			jbtnBack = new JButton();
			jbtnBack.setBounds(new Rectangle(75, 135, 123, 29));
			jbtnBack.setText("Back");
		}
		return jbtnBack;
	}
	/**
	 * Set displayed data  Book Id and Book popularity 
	 * @param bookid Book serial
	 * @param data Book popularity
	 */
	public void setTextP(String bookid,float data)
	{
		jtxtBookId.setText(bookid);
		jtxtBookId.setEnabled(false);
		jlblBookPop.setText(Float.toString(data) + "%");
	}

} 
